﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage_Admin.master" AutoEventWireup="true"
    CodeFile="GaugeEdit.aspx.cs" Inherits="Admin_Gauge_GaugeEdit" %>

<%--ValidateRequest="false" --%>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">

    <style type="text/css">
        #div_Radio {
        }

            #div_Radio tr {
            }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="Server">
    <a href="list.aspx">量表管理</a><span>-新增</span>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="Server">
    <div class="ht-panel-edit">
        <table class="ht-edit-table">
            <tr>
                <th>量表类型：</th>
                <td>
                    <asp:DropDownList ID="ddl_GaugeType" runat="server" CssClass="ht-select"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="ddl_GaugeType" InitialValue="0" ValidationGroup="Group"></asp:RequiredFieldValidator>
                    <asp:HiddenField ID="hf_GaugeId" runat="server" Value="-1" />
                </td>
            </tr>
            <tr>
                <th>量表标题：</th>
                <td>
                    <asp:TextBox ID="txt_Title" runat="server" CssClass="ht-text"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate="txt_Title" ValidationGroup="Group"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>是否启用：</th>
                <td>
                    <asp:CheckBox ID="ch_Valid" runat="server" Checked="true" />
                </td>
            </tr>
            <tr>
                <th></th>
                <td>
                    <asp:LinkButton ID="btn_Modify" runat="server" Text="编辑" class="easyui-linkbutton" data-options="iconCls:'icon-edit'" OnClick="btn_Modify_Click" CssClass="easyui-linkbutton" />
                    <asp:LinkButton ID="btn_Save" runat="server" Text="保存" class="easyui-linkbutton" data-options="iconCls:'icon-save'" OnClick="btn_Save_Click" CssClass="easyui-linkbutton" ValidationGroup="Group" />
                    <a href="GaugeList.aspx" class="easyui-linkbutton" data-options="iconCls:'icon-undo'">返回</a>
                </td>
            </tr>
        </table>
    </div>

    <asp:Panel ID="panel_Edit" runat="server">
        <p style="padding: 5px; margin-top: 20px;">
            <strong>题目列表：</strong>
            <a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="showTestItemWindows(-1)">添加题目</a>
            <a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="showTestItemWindows2(-1)">添加列表</a>
        </p>
        <div>
            <table id="grid_GaugeTest" class="ht-grid">
                <thead>
                    <tr>
                        <th>ID
                        </th>
                        <th>题型
                        </th>
                        <th>题目
                        </th>
                        <th>状态
                        </th>
                        <th>操作
                        </th>
                    </tr>
                </thead>
            </table>

        </div>

        <div id="winTestItem" class="easyui-window" data-options="title:'题目编辑',iconCls:'icon-save',modal:true" style="width: 660px; height: 440px;">
            <div class="easyui-layout" data-options="fit:true">
                <div data-options="region:'center',border:false" style="background: #fff; padding: 5px;">
                    <div class="ht-panel-edit" style="padding: 5px">
                        <table class="ht-edit-table">
                            <tr>
                                <th style="vertical-align: top">题目类型：</th>
                                <td>
                                    <select id="ddl_TestType" class="ht-select" onchange="ddl_TestTypeChange()">
                                        <option value="RADIO">单选题</option>
                                        <option value="CHECKBOX">复选题</option>
                                        <%--<option value="TEXT">填空题</option>--%>
                                        <option value="AREATEXT">简答题</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th>题目标题：</th>
                                <td>
                                    <textarea id="txt_TestTitle" class="ht-area" style="width: 520px; height: 50px;"></textarea>
                                    <input type="hidden" id="hf_GaugeTestId" value="-1" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="div_Radio">
                        <p>
                            <strong>选项列表：</strong>
                            <a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="addRadioItem(-1,'',0,false)">添加</a>
                        </p>
                        <table class="ht-grid" id="grid_radio">
                            <tr>
                                <th style="display: none">ID</th>
                                <th>选项内容</th>
                                <th style="width: 60px">分值</th>
                                <th style="width: 120px; text-align: center">显示文本框</th>
                                <th style="width: 80px">操作</th>
                            </tr>
                        </table>

                    </div>
                </div>
                <div data-options="region:'south',border:false" style="text-align: right; padding: 5px; border-top: solid 1px #ccc;">
                    <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:SaveTestData()">保存</a>
                    <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#winTestItem').window('close')">取消</a>
                </div>
            </div>
        </div>

        <%--步态分析表--%>
        <div id="winTestItem2" class="easyui-window" data-options="title:'题目编辑',iconCls:'icon-save',modal:true,maximized:true" style="width: 680px; height: 450px;">
            <div class="easyui-layout" data-options="fit:true">

                <div data-options="region:'center',border:false" style="background: #fff; padding: 5px;">
                    <input type="hidden" id="hf_grid_GaugeTestItemId" />
                    <p>
                        <b>列表列数：</b>
                        <input type="text" class="ht-text" id="txtGridColCount" style="width: 60px" value="11" />
                        <b>列表行数：</b>
                        <input type="text" class="ht-text" id="txtGridRowCount" style="width: 60px" value="12" />
                        <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        <b>表头行数：</b>
                        <input type="text" class="ht-text" id="txtHeadRowCount" style="width: 60px" value="3" />
                        <b>行固定列数：</b>
                        <input type="text" class="ht-text" id="txtRowColCount" style="width: 60px" value="2" />
                        <a href="javascript:void()" onclick="showGridSetting()">设置</a>
                    </p>

                    <table class="ht-grid" id="setGrid">
                    </table>

                    <hr />
                    <p>
                        <a href="javascript:void(0)" onclick="testGrid()">预览</a>
                    </p>
                    <table id="test-grid" class="test-table">
                    </table>
                    <style type="text/css">
                        .test-table {
                            width: 100%;
                        }

                            .test-table th {
                                border: solid 1px red;
                                text-align: center;
                            }

                            .test-table td {
                                border: solid 1px red;
                                vertical-align: top;
                            }
                    </style>
                </div>

                <div data-options="region:'south',border:false" style="text-align: right; padding: 5px; border-top: solid 1px #ccc;">
                    <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:saveGridData()">保存</a>
                    <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#winTestItem2').window('close')">取消</a>
                </div>
            </div>
        </div>

        <%--步态分析表--%>
        <div id="winTestItem3" class="easyui-window" data-options="title:'题目编辑',iconCls:'icon-save',modal:true,maximized:false" style="width: 680px; height: 450px;">
            <div class="easyui-layout" data-options="fit:true">

                <div data-options="region:'center',border:false" style="background: #fff; padding: 5px;">

                    <table style="width: 98%">
                        <tr>
                            <td style="width: 50%; vertical-align: top">
                                <div style="height: 356px; border-right: solid 1px #CCC;padding:5px">
                                    <h1>表头维护</h1>
                                    <table class="ht-grid">
                                        <thead>
                                            <tr>
                                                <th>表头文本</th>
                                                <th>分值</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="1分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="1" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="2分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="2" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="3分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="3" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="3分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="4" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="5分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="5" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="6分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="6" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 100px" value="7分" />
                                                </td>
                                                <td>
                                                    <input type="text" class="ht-text" style="width: 60px" value="7" />
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                            <td style="width: 50%; vertical-align: top">
                                <div style="padding:5px">
                                    <h1>行固定列维护</h1>
                                    <ul class="easyui-tree">
                                        <li>
                                            <span>自理能力</span>
                                            <ul>
                                                <li>
                                                    <span>进食</span>
                                                </li>
                                                <li>
                                                    <span>梳洗修饰</span>
                                                </li>
                                                <li>
                                                    <span>洗澡</span>
                                                </li>
                                                <li>
                                                    <span>穿裤子</span>
                                                </li>
                                                <li>
                                                    <span>穿上衣</span>
                                                </li>
                                                <li>
                                                    <span>上厕所</span>
                                                </li>
                                            </ul>
                                        </li>
                                        <li>
                                            <span>括约肌控制</span>
                                            <ul>
                                                <li>膀胱管理</li>
                                                <li>直肠管理</li>
                                            </ul>
                                        </li>

                                    </ul>
                                </div>
                            </td>

                        </tr>
                    </table>
                </div>

                <div data-options="region:'south',border:false" style="text-align: right; padding: 5px; border-top: solid 1px #ccc;">
                    <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:saveGridData()">保存</a>
                    <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#winTestItem2').window('close')">取消</a>
                </div>
            </div>
        </div>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Footer" runat="Server">

    <!--题目列表-->
    <script type="text/javascript">
        var GaugeId = $('#<%=hf_GaugeId.ClientID %>').val();
    </script>

    <script src="../../Resources/js/json2.js"></script>
    <script src="GaugeEdit_Grid.js"></script>
    <script src="GaugeEdit.js"></script>
    <!--加载-->
    <script type="text/javascript">
        $(function () {
            $('#winTestItem').window('close');
            $('#winTestItem2').window('close');

            BindGaugeTestList(GaugeId);
        });
    </script>
    <!--KindEdit-->

    <style>
        .ke-icon-text1 {
            background-image: url(/Resources/js/kindeditor/themes/default/default.png);
            background-position: 0px -672px;
            width: 16px;
            height: 16px;
        }

        .ke-icon-text2 {
            background-image: url(/Resources/js/kindeditor/themes/default/default.png);
            background-position: 0px -672px;
            width: 16px;
            height: 16px;
        }

        .ke-icon-text3 {
            background-image: url(/Resources/js/kindeditor/themes/default/default.png);
            background-position: 0px -672px;
            width: 16px;
            height: 16px;
        }

        .ke-icon-text4 {
            background-image: url(/Resources/js/kindeditor/themes/default/default.png);
            background-position: 0px -672px;
            width: 16px;
            height: 16px;
        }
    </style>
    <script src="../../Resources/js/kindeditor/kindeditor-min.js"></script>
    <script src="../../Resources/js/kindeditor/lang/zh_CN.js"></script>
    <script>
        var editor;
        // 自定义插件 #1
        KindEditor.lang({
            text1: '文本框1'
        });
        KindEditor.plugin('text1', function (K) {
            var self = this, name = 'text1';
            self.clickToolbar(name, function () {
                self.insertHtml('<input type=\"text\" style=\"margin:2px;width:100px\"/>');
            });
        });
        // 自定义插件 #2
        KindEditor.lang({
            text2: '文本框2'
        });
        KindEditor.plugin('text2', function (K) {
            var self = this, name = 'text2';
            self.clickToolbar(name, function () {
                self.insertHtml('<input type=\"text\" style=\"margin:2px;width:150px\"/>');
            });
        });
        // 自定义插件 #3
        KindEditor.lang({
            text3: '文本框3'
        });
        KindEditor.plugin('text3', function (K) {
            var self = this, name = 'text3';
            self.clickToolbar(name, function () {
                self.insertHtml('<input type=\"text\" style=\"margin:2px;width:250px\"/>');
            });
        });
        // 自定义插件 #2
        KindEditor.lang({
            text4: '文本框4'
        });
        KindEditor.plugin('text4', function (K) {
            var self = this, name = 'text4';
            self.clickToolbar(name, function () {
                self.insertHtml('<input type=\"text\" style=\"margin:2px;width:500px\"/>');
            });
        });
        KindEditor.ready(function (K) {
            editor = K.create('#txt_TestTitle', {
                items: ['text1', 'text2', 'text3', 'text4'],
                filterMode: false
            });
        });
    </script>
</asp:Content>

